package com.neutech.neusys.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.neutech.neusys.mapper.ConstantitemMapper;
import com.neutech.neusys.mapper.DepartmentMapper;
import com.neutech.po.ConstantItem;
import com.neutech.po.Department;
import com.neutech.neusys.service.DepartmentService;
import com.neutech.neusys.vo.ToAddDeartmentVo;
@Service
public class DepartmentServiceImpl implements DepartmentService{
	@Autowired
	private DepartmentMapper departmentMapper;
	@Autowired
	private ConstantitemMapper constantitemMapper;

	@Override
	public int addDepartment(Department department) {
		int num = departmentMapper.addDepartment(department);
		return num;
	}

	@Override
	public ToAddDeartmentVo toAddConstantitem() {
		List<ConstantItem> conList = constantitemMapper.fqueryAll();
		List<ConstantItem> conList1 = constantitemMapper.findQueryAlls();
		ToAddDeartmentVo vo = new ToAddDeartmentVo();
		vo.setConList(conList);
		vo.setConList1(conList1);
		return vo;
	}

	@Override
	public List<Department> queryAllDept() {
		return departmentMapper.queryAllDept();
	}
}
